package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import nl.coderight.jazz.dialog.MessageDialog;
import nl.coderight.jazz.dialog.MessageType;
import jtk.project4.fleet.domain.Attachments;




public class AttachmentsDao extends IbatisDao{
	
	public List selectAttachments() throws SQLException {
		List selectAttachments = null;
		selectAttachments =getSqlMap().queryForList("SELECT_ALL_ATTACHMENTS", null);
		return selectAttachments;
	}

	public int deleteAttachments(Attachments attachments) throws SQLException{
		return (int) getSqlMap().delete("DELETE_ATTACHMENTS", attachments);
	}
	
	public int updateAttachments(Attachments attachments) throws SQLException{
		return (int) getSqlMap().update("UPDATE_ATTACHMENTS", attachments);
	}
	
	public Attachments insertAttachments(Attachments attachments) throws SQLException{
		return (Attachments) getSqlMap().insert("INSERT_ATTACHMENTS", attachments);
	}

	/*public Vendor insertVendorType(Attachments attachments) throws SQLException {
		return (Vendor) getSqlMap().insert("INSERT_VENDOR_TYPE",vendor);
	}*/
	
		/*public List selectVendorType() throws SQLException {
		return getSqlMap().queryForList("SELECT_ALL_VENDOR_TYPE", null);
	}*/
	
		
	public static void main (String args[]) throws SQLException{
		Attachments attachments;
		attachments = new Attachments();
		//attachments.setDocId(4);
		//attachments.setObjectId(null);
		//attachments.setpath(null);
		//attachments.setDescription(null);
		//attachments.setCreateDate(null);
		//attachments.setCreateId(null);
		//attachments.setModifyDate(null);
		//attachments.setModifyId(null);
		attachments.setDescription("lolo");
		new AttachmentsDao().insertAttachments(attachments);
		}
	
}